﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Helper.Core.Entity;
using System.Collections;

namespace Helper.Controllers
{
    public partial class StatusController : BaseController
    {        
        [HttpGet]
        [ActionName("GetAll")]
        public JsonResult GetAll()
        {
            JsonResult result = new JsonResult();
            result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            IEnumerable dataReturn = _StatusRepository.GetAll().Select(obj => new { 
                Id = obj.Id, 
                Name = obj.Name,
                Conclusive = obj.Conclusive ? "Sim" : "Não",
                Dependency = obj.Dependency.ToString(),
                Shown = obj.Shown.ToString()
            }).ToList();
            result.Data = dataReturn;
            return result;
        }
    }
}
